home *** CD-ROM | disk | FTP | other *** search
/ Workbench Designer 2 / Workbench Designer 2.iso / bootbilder / bootpicture / amiga_ecs / bootpicture.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-06  |  2.3 KB  |  106 lines

  1. /****************************************
  2. *
  3. *    Name        BootPicture
  4. *    Version        1.50
  5. *    Date        6 May 1996
  6. *    Compiler    SAS C/C++ 6.55
  7. *    Code        Wojciech Jeczmien  email: jeczmien@panda.bg.univ.gda.pl
  8. *    Further code    Tak Tang           email: tst92@ecs.soton.ac.uk
  9. *    Picture     Michael Becker     email: nf198@fim.uni-erlangen.de
  10. *
  11. ****************************************/
  12.  
  13.  
  14. /*** Definitions ***/
  15.  
  16. #define IM_WIDTH    403
  17. #define IM_HEIGHT    258
  18. #define IM_DEPTH    4
  19. #define IM_NUMCOLS    (1 << IM_DEPTH)
  20. #define IM_LACE        1
  21. #define IM_NAME        "AmigaTechnologies_ECS"
  22. #define IM_DELAY    50
  23. #define BPVER    "1.50"
  24. #define BPDATE    "06.05.96"
  25.  
  26. /*** Header files ***/
  27.  
  28. #include <string.h>
  29. #include <stdlib.h>
  30. #include <intuition/intuition.h>
  31. #include <intuition/intuitionbase.h>
  32. #include <graphics/gfxbase.h>
  33. #include <proto/intuition.h>
  34. #include <proto/graphics.h>
  35. #include <proto/dos.h>
  36.  
  37.  
  38. /*** External data structures ***/
  39.  
  40. extern struct Image im;
  41. extern UWORD cmap[];
  42. extern USHORT sprite_data[4];
  43.  
  44.  
  45. /*** Local data structures ***/
  46.  
  47. char verstag[]="$VER: BootPicture " BPVER " (" BPDATE ")\0";
  48. char title[]="BootPicture " IM_NAME;
  49.  
  50.  
  51. /*** Main Program ***/
  52.  
  53. void main()
  54. {
  55.     struct Screen *scr;
  56.     struct Window *mywin;
  57.     int scr_ntsc= (GfxBase->DisplayFlags & NTSC)?(IM_LACE?56:28):0;
  58.  
  59.     if (!(scr=OpenScreenTags(NULL,
  60.         SA_Left, 320 - (IM_WIDTH / 2) ,
  61.         SA_Top,  (IM_LACE?256:128) - (IM_HEIGHT / 2) - scr_ntsc,
  62.         SA_Width,IM_WIDTH,
  63.         SA_Height,IM_HEIGHT,
  64.         SA_Depth,IM_DEPTH,
  65.         SA_Title,title,
  66.         SA_Quiet,TRUE,
  67.         SA_ShowTitle,FALSE,
  68.         SA_Type,CUSTOMSCREEN,
  69.         SA_DisplayID, IM_LACE?HIRESLACE_KEY:HIRES_KEY,
  70.         SA_Draggable,FALSE,
  71.         TAG_DONE )))
  72.             exit(0);
  73.  
  74.     if (!(mywin=OpenWindowTags(NULL,
  75.         WA_Left,0,
  76.         WA_Top,0,
  77.         WA_Width,IM_WIDTH,
  78.         WA_Height,IM_HEIGHT,
  79.         WA_Flags,WFLG_SMART_REFRESH | WFLG_BORDERLESS | ACTIVATE | WFLG_RMBTRAP,
  80.         WA_CustomScreen,scr,
  81.         TAG_DONE))) {
  82.             CloseScreen(scr);
  83.             exit(0);
  84.     }
  85.  
  86.     SetPointer(mywin,sprite_data, 0, 0, 0, 0);
  87.  
  88.     LoadRGB4(&scr->ViewPort,cmap,IM_NUMCOLS); /* -- ECS */
  89.     /*LoadRGB32(&scr->ViewPort,cmap); -- AGA */
  90.  
  91.     DrawImage(mywin->RPort,&im,0,0);
  92.  
  93.     /* Wait until screen is not frontmost */
  94.     while (TRUE){
  95.         Delay(IM_DELAY);
  96.         if (strcmp(IntuitionBase->FirstScreen->DefaultTitle,title))
  97.             break;
  98.     }
  99.  
  100.     /* Close windows and screens */
  101.     CloseWindow(mywin);
  102.     CloseScreen(scr);
  103. } // main
  104.  
  105. /*** End of program ***/
  106.